require 'task'
require "logging"
logger = logging.new("%date.log",30);

----------------------------
task.register( 'Main' )
local myid = task.id ()
local tskWork = task.create( "init.lua" )
if tskWork == -1 then
	logger:info( "Task-> Can't expand task list." )
elseif tskWork == -2 then
	logger:info( "Task-> Can't strdup file name." )
elseif tskWork == -3 then
	logger:info( "Task-> Can't create message queue." )
elseif tskWork == -4 then
	logger:info( "Task-> Can't create os thread." )
elseif tskWork == -11 then
	logger:info( "Task-> The library seems corrupt." )
else
end

while true do
	local cmd = io.stdin:read('*l')
	if cmd == 'quit' then
		break;
	end
end
task.post ( tskWork , 'quit', myid)
task.receive ( -1 )
